#include "Log.hpp"
#include <memory> //智能指针头文件
using namespace LogModule;
using namespace std;

int main()
{
    // make_unique构建对象返回智能指针的做法——c++14
    // 往显示器上打就构建ConsoleLogStrategy对象的智能指针
    // unique_ptr<LogStrategy> strategy = make_unique<ConsoleLogStrategy>();
    // unique_ptr<LogStrategy> strategy = make_unique<FileLogStrategy>();
    // strategy指针，实际指向ConsoleLogStrategy对象智能指针
    // 通过基类指针调用纯虚函数SyncLog
    // 运行时会根据实际对象类型ConsoleLogStrategy执行对应子类的重写实现
    // strategy->SyncLog("hello log!");

    // 使用全局的Logger类对象
    // logger.EnableFileLogStrategy();
    // logger(LogLevel::DEBUG, "main.cc", 10) << "hello world" << 3.14 << " " << 8899;

    // 使用宏之后
    Enable_Console_Log_Strategy();
    LOG(LogLevel::DEBUG) << "hello world " << 3.14 << " " << 666;
    LOG(LogLevel::DEBUG) << "hello Log! " << 3.14 << " " << 666;
    LOG(LogLevel::DEBUG) << "hello Thread!! " << 3.14 << " " << 666;

    return 0;
}